using UnityEngine;

namespace CGF
{
    public partial class CommAssets : PrefabComponentBase, IAwake<Transform>, IDestroy
    {
        public static CommAssets instance;
        
        //该方法支持创建多个，并返回对象，删除可调用返回对象的 .Destroy() 方法
        public static CommAssets Create(ComponentBase parentComponent, Transform parentTransform)
        {
            return parentComponent.AddChild<CommAssets, Transform>(parentTransform);
        }
    
        public async void Awake(Transform parent)
        {
            await SpawnPrefab("Prefabs/Common/CommAssets", parent);
			BindProperties(transform);
            GameObject.DontDestroyOnLoad(gameObject);
            instance = this;
        }
        
        public string[] vipNames
        {
            get
            {
                return new []
                {
                    I18N_vip0_name,
                    I18N_vip1_name,
                    I18N_vip2_name,
                    I18N_vip3_name,
                    I18N_vip4_name,
                    I18N_vip5_name,
                };
            }
        }

        public void Show(bool b)
        {
            if (gameObject) gameObject.SetActive(b);
        }

        public override void OnDestroy()
        {
            base.OnDestroy();
        }

    }
}
